package com.tree.demo;

/**
 * 递归的小Demo
 * 计算1-1000的累加
 */
public class RecursiveCall {

    public static int addNumber(int number){
        if(number>=1000){
            return number;
        }
        number+=addNumber(number+1);
        return number;
    }


    public static void main(String[] args) {
        System.out.println(addNumber(1));
    }

}
